#ifndef CONVERSIONS_H
#define CONVERSIONS_H

#include <QStringList>

#include <qmath.h>

#include <QDebug>

// Definitions
#define CONCERT_PITCH_REFERENCE "A"
#define CONCERT_PITCH_FREQUENCY 440.0

// Enum type for instrument and temperament
enum Temperament { Equal, PitagoreanUp, PitagoreanDown }; //TODO: IMPLEMENT!
// Equal: 100 cents offset
// Pitagorean: 2,3, powers intervals
// UP: discard Gb
// Down: discard F#

// Get full list of name (display = true for Human, false for computer)
QStringList PitchNoteList(bool disp = true, bool lat = false);
QStringList AlterNoteList(bool disp = true);
QStringList EquiNoteList(bool disp = true, bool lat = false);
QStringList OctaveList(bool disp = true);
QStringList ClefList(bool disp = true);
QStringList TemperamentList(bool disp = true);

// Temperament conversion
Temperament toTemperament(QString str);
Temperament toTemperament(int index);

// Replace stupid C integer difision
// Down approx division
int MathDivide(int a, int b);
// No negative reminder
int MathReminder(int a, int b);

// Conversion talbe (cents and frequencies)
int centsDiff(qreal freq1, qreal freq2);
//qreal fromFreqCentsDiff(qreal freq, int cents);
qreal getRatioFreq(int cent_diff, Temperament temp = Equal);

#endif // CONVERSIONS_H
